package A1_1_Thoroughbred;

import java.util.Calendar;
public class Thoroughbred {
    // 私有属性
    private String mother;
    private String father;
    private int birthyear;

    // 构造方法
    public Thoroughbred(String mother, String father, int birthyear) {
        this.mother = mother;
        this.father = father;
        this.birthyear = birthyear;
    }

    // 获取当前年龄
    public int getCurrentAge() {
        Calendar calendar = Calendar.getInstance();
        int currentYear = calendar.get(Calendar.YEAR);
        return currentYear - birthyear;
    }

    // 获取父亲信息
    public String getFather() {
        return father;
    }

    // 获取母亲信息
    public String getMother() {
        return mother;
    }
}